package Cache;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import org.junit.Test;
import java.util.concurrent.TimeUnit;


public class TestCache {
    public static final Cache<Object, Object> cache = CacheBuilder.newBuilder().expireAfterAccess(60, TimeUnit.MINUTES).build();
    public static void main(String[] args) {
        cache.put(1,"张三");
        System.out.println(cache.getIfPresent(1));
    }
//    测试
    @Test
    public void test22(){
        System.out.println(cache.getIfPresent(1));
    }


}
